<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => assert_selection(
     '<div contenteditable="true"><table><tr><td><ol><li>a</li><li>|</li></ol></td><td>b</td></tr></table></div>',
     'Delete',
     '<div contenteditable="true"><table><tbody><tr><td><ol><li>a|</li></ol></td><td>b</td></tr></tbody></table></div>'),
     'Delete - When deleting the second ordered list items in a table cell its content is merged with the first list item.');

test(() => assert_selection(
     '<div contenteditable="true"><table><tr><td><ul><li>a</li><li>|</li></ul></td><td>b</td></tr></table></div>',
     'Delete',
     '<div contenteditable="true"><table><tbody><tr><td><ul><li>a|</li></ul></td><td>b</td></tr></tbody></table></div>'),
     'Delete - When deleting the second unordered list items in a table cell its content is merged with the first list item.');

test(() => assert_selection(
     '<div contenteditable="true"><table><tr><td><ol><li>|</li></ol></td></tr></table></div>',
     'Delete',
     '<div contenteditable="true"><table><tbody><tr><td><div>|<br></div></td></tr></tbody></table></div>'),
     'Delete - When deleting the last ordered list item in a table cell we must delete the whole ordered list.');

test(() => assert_selection(
     '<div contenteditable="true"><table><tr><td><ul><li>|</li></ul></td></tr></table></div>',
     'Delete',
     '<div contenteditable="true"><table><tbody><tr><td><div>|<br></div></td></tr></tbody></table></div>'),
     'Delete - When deleting the last unrdered list item in a table cell we must delete the whole unordered list.');
</script>
